import requests
import os

def test_document_upload():
    """Test document upload functionality"""
    url = 'http://localhost:5000/api/documents/upload'
    
    # Create a test PDF file path
    test_file_path = 'test_regulation.pdf'  # Replace with actual test file
    
    if not os.path.exists(test_file_path):
        print("Test file not found!")
        return
    
    files = {
        'file': open(test_file_path, 'rb')
    }
    
    data = {
        'country': 'USA',
        'document_type': 'Regulation',
        'regulation_id': 'CFR 21 Part 860.3',
        'issuing_authority': 'FDA',
        'effective_date': '2024-01-01',
        'version': 'v1.0'
    }
    
    response = requests.post(url, files=files, data=data)
    print(f"Status: {response.status_code}")
    print(f"Response: {response.json()}")

if __name__ == "__main__":
    test_document_upload()